Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve field order when updating kustomization.yaml file #666

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

jtdoepke
Copy link
Contributor

@jtdoepke jtdoepke commented Jan 9, 2024

This commit causes argocd-image-updater to preserve the order of fields in the kustomization.yaml file when updating the image(s). Doing so will minimize git diffs in the case that other tools also edit the kustomization.yaml file.

Fixes #502

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2024

Codecov Report

Attention: Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.

Project coverage is 67.84%. Comparing base (2bf4b0a) to head (a98c209).

Files Patch % Lines
pkg/argocd/git.go 30.76% 4 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #666      +/-   ##
==========================================
- Coverage   67.98%   67.84%   -0.15%     
==========================================
  Files          31       31              
  Lines        3124     3135      +11     
==========================================
+ Hits         2124     2127       +3     
- Misses        856      860       +4     
- Partials      144      148       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jtdoepke
Copy link
Contributor Author

jtdoepke commented Jan 9, 2024

The build_image job failed, but I'm pretty sure that's not due to my changes.

pkg/argocd/git_test.go Outdated Show resolved Hide resolved
@chengfang
Copy link
Collaborator

@jtdoepke can you also fix the DCO failure with sign-off?

This commit causes argocd-image-updater to preserve the order of fields
in the kustomization.yaml file when updating the image(s). Doing so will
minimize git diffs in the case that other tools also edit the
kustomization.yaml file.

Fixes argoproj-labs#502

Signed-off-by: Jaye Doepke <jdoepke@mintel.com>
@chengfang chengfang merged commit 50360e9 into argoproj-labs:master Jul 17, 2024
10 checks passed
@chengfang
Copy link
Collaborator

@jtdoepke thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retain or sort YAML ordering of images component when using Git write-back method
3 participants